Skip to content

Restart mullvad-daemon after user grants Full Disk Access (macOS) #6381

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

MarkusPettersson98
Copy link
Contributor

@MarkusPettersson98 MarkusPettersson98 commented Jun 19, 2024

This PR fixes an issue where the mullvad-daemon would not automatically restart after the user had granted "Mullvad VPN" application Full Disk Access. This is needed to make split tunneling work.


This change is Reviewable

Copy link

linear bot commented Jun 19, 2024

Comment on lines 231 to 241
println!();
println!(r#"Enable "Full Disk Access" for "Mullvad VPN" in the macOS system settings:"#);
println!(r#"open "x-apple.systempreferences:com.apple.preference.security?Privacy_AllFiles"#);
println!();
println!("Restart the Mullvad daemon for the change to take effect:");
println!("launchctl unload -w /Library/LaunchDaemons/net.mullvad.daemon.plist");
println!("launchctl load -w /Library/LaunchDaemons/net.mullvad.daemon.plist");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not write it using a single println!?

Suggested change
println!();
println!(r#"Enable "Full Disk Access" for "Mullvad VPN" in the macOS system settings:"#);
println!(r#"open "x-apple.systempreferences:com.apple.preference.security?Privacy_AllFiles"#);
println!();
println!("Restart the Mullvad daemon for the change to take effect:");
println!("launchctl unload -w /Library/LaunchDaemons/net.mullvad.daemon.plist");
println!("launchctl load -w /Library/LaunchDaemons/net.mullvad.daemon.plist");
println!(r#"
Enable "Full Disk Access" for "Mullvad VPN" in the macOS system settings:
open "x-apple.systempreferences:com.apple.preference.security?Privacy_AllFiles
Restart the Mullvad daemon for the change to take effect:
launchctl unload -w /Library/LaunchDaemons/net.mullvad.daemon.plist
launchctl load -w /Library/LaunchDaemons/net.mullvad.daemon.plist
"#);

@dlon dlon force-pushed the failed-to-enable-split-tunneling-on-macos-145-intel-des-1034 branch 2 times, most recently from ed98887 to 31717ae Compare June 19, 2024 12:29
Copy link
Contributor

@Serock3 Serock3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 2 of 5 files at r1, 1 of 3 files at r2, 5 of 5 files at r4, all commit messages.
Reviewable status: 8 of 9 files reviewed, 1 unresolved discussion (waiting on @MarkusPettersson98)


gui/src/main/tunnel-state.ts line 24 at r3 (raw file):

Previously, dlon (David Lönnhager) wrote…

IMO, that would be worse. As is, TunnelStateHandler doesn't need to care what the boolean is used for. If it were renamed to shutdownDaemonWhenGuiCloses then it would couple it (slightly) more with the main class.

Sure, I agree with that argument

@MarkusPettersson98 MarkusPettersson98 force-pushed the failed-to-enable-split-tunneling-on-macos-145-intel-des-1034 branch from cad055f to 4c27ce1 Compare June 20, 2024 08:06
@MarkusPettersson98 MarkusPettersson98 marked this pull request as ready for review June 20, 2024 08:06
@MarkusPettersson98 MarkusPettersson98 force-pushed the failed-to-enable-split-tunneling-on-macos-145-intel-des-1034 branch 2 times, most recently from ea040d8 to 7784c67 Compare June 20, 2024 08:40
Copy link
Member

@dlon dlon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 6 of 6 files at r5, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @MarkusPettersson98)

@dlon dlon force-pushed the failed-to-enable-split-tunneling-on-macos-145-intel-des-1034 branch from 79eec40 to de9beaa Compare June 20, 2024 10:51
Copy link
Member

@dlon dlon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 of 5 files at r4, 3 of 3 files at r6, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @MarkusPettersson98)

@MarkusPettersson98 MarkusPettersson98 force-pushed the failed-to-enable-split-tunneling-on-macos-145-intel-des-1034 branch from de9beaa to 6d638ee Compare June 20, 2024 11:04
- Add option to automatically shutdown daemon on after running through
the same safety routine as `PrepareRestart`. This is exposed via a new
gRPC call called `PrepareRestartV2`.
- Add help text for enabling full disk access to the CLI
@MarkusPettersson98 MarkusPettersson98 force-pushed the failed-to-enable-split-tunneling-on-macos-145-intel-des-1034 branch from 6d638ee to 751026b Compare June 20, 2024 11:06
Copy link
Member

@dlon dlon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 2 of 2 files at r7, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @MarkusPettersson98)

Copy link
Contributor

@Serock3 Serock3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

@MarkusPettersson98 MarkusPettersson98 merged commit 1031eeb into main Jun 20, 2024
49 checks passed
@MarkusPettersson98 MarkusPettersson98 deleted the failed-to-enable-split-tunneling-on-macos-145-intel-des-1034 branch June 20, 2024 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants